1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module adw.PreferencesRow; 26 27 private import adw.c.functions; 28 public import adw.c.types; 29 private import glib.ConstructionException; 30 private import glib.Str; 31 private import glib.c.functions; 32 private import gobject.ObjectG; 33 private import gtk.AccessibleIF; 34 private import gtk.AccessibleT; 35 private import gtk.ActionableIF; 36 private import gtk.ActionableT; 37 private import gtk.BuildableIF; 38 private import gtk.BuildableT; 39 private import gtk.ConstraintTargetIF; 40 private import gtk.ConstraintTargetT; 41 private import gtk.ListBoxRow; 42 private import gtk.Widget; 43 44 45 /** 46 * A [class@Gtk.ListBoxRow] used to present preferences. 47 * 48 * The `AdwPreferencesRow` widget has a title that [class@PreferencesWindow] 49 * will use to let the user look for a preference. It doesn't present the title 50 * in any way and lets you present the preference as you please. 51 * 52 * [class@ActionRow] and its derivatives are convenient to use as preference 53 * rows as they take care of presenting the preference's title while letting you 54 * compose the inputs of the preference around it. 55 * 56 * Since: 1.0 57 */ 58 public class PreferencesRow : ListBoxRow 59 { 60 /** the main Gtk struct */ 61 protected AdwPreferencesRow* adwPreferencesRow; 62 63 /** Get the main Gtk struct */ 64 public AdwPreferencesRow* getPreferencesRowStruct(bool transferOwnership = false) 65 { 66 if (transferOwnership) 67 ownedRef = false; 68 return adwPreferencesRow; 69 } 70 71 /** the main Gtk struct as a void* */ 72 protected override void* getStruct() 73 { 74 return cast(void*)adwPreferencesRow; 75 } 76 77 /** 78 * Sets our main struct and passes it to the parent class. 79 */ 80 public this (AdwPreferencesRow* adwPreferencesRow, bool ownedRef = false) 81 { 82 this.adwPreferencesRow = adwPreferencesRow; 83 super(cast(GtkListBoxRow*)adwPreferencesRow, ownedRef); 84 } 85 86 87 /** */ 88 public static GType getType() 89 { 90 return adw_preferences_row_get_type(); 91 } 92 93 /** 94 * Creates a new `AdwPreferencesRow`. 95 * 96 * Returns: the newly created `AdwPreferencesRow` 97 * 98 * Since: 1.0 99 * 100 * Throws: ConstructionException GTK+ fails to create the object. 101 */ 102 public this() 103 { 104 auto __p = adw_preferences_row_new(); 105 106 if(__p is null) 107 { 108 throw new ConstructionException("null returned by new"); 109 } 110 111 this(cast(AdwPreferencesRow*) __p); 112 } 113 114 /** 115 * Gets the title of the preference represented by @self. 116 * 117 * Returns: the title 118 * 119 * Since: 1.0 120 */ 121 public string getTitle() 122 { 123 return Str.toString(adw_preferences_row_get_title(adwPreferencesRow)); 124 } 125 126 /** 127 * Gets whether the user can copy the title from the label 128 * 129 * Returns: whether the user can copy the title from the label 130 * 131 * Since: 1.1 132 */ 133 public bool getTitleSelectable() 134 { 135 return adw_preferences_row_get_title_selectable(adwPreferencesRow) != 0; 136 } 137 138 /** 139 * Gets whether an embedded underline in the title indicates a mnemonic. 140 * 141 * Returns: whether an embedded underline in the title indicates a mnemonic 142 * 143 * Since: 1.0 144 */ 145 public bool getUseUnderline() 146 { 147 return adw_preferences_row_get_use_underline(adwPreferencesRow) != 0; 148 } 149 150 /** 151 * Sets the title of the preference represented by @self. 152 * 153 * Params: 154 * title = the title 155 * 156 * Since: 1.0 157 */ 158 public void setTitle(string title) 159 { 160 adw_preferences_row_set_title(adwPreferencesRow, Str.toStringz(title)); 161 } 162 163 /** 164 * Sets whether the user can copy the title from the label 165 * 166 * Params: 167 * titleSelectable = `TRUE` if the user can copy the title from the label 168 * 169 * Since: 1.1 170 */ 171 public void setTitleSelectable(bool titleSelectable) 172 { 173 adw_preferences_row_set_title_selectable(adwPreferencesRow, titleSelectable); 174 } 175 176 /** 177 * Sets whether an embedded underline in the title indicates a mnemonic. 178 * 179 * Params: 180 * useUnderline = `TRUE` if underlines in the text indicate mnemonics 181 * 182 * Since: 1.0 183 */ 184 public void setUseUnderline(bool useUnderline) 185 { 186 adw_preferences_row_set_use_underline(adwPreferencesRow, useUnderline); 187 } 188 }